package org.cjlm.ui.pub;

import javax.swing.*;
import java.awt.*;
import java.util.HashMap;
import java.util.Map;

public class MTabbedPane extends JTabbedPane {

    private final Map<Integer, String> tablecodes = new HashMap<>();

    public void addTab(String tablecode, String tablename, Component component, int index) {
        super.insertTab(tablename, null, component, null, index);
        this.tablecodes.put(index,tablecode);
    }

    public String getSelectTablecode(){
        int index = getSelectedIndex();
        return tablecodes.get(index);
    }
}
